package com.konsung.ksdc.common.widget;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.TextView;

import com.konsung.ksdc.R;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * 进度条
 * Created by JustRush on 2015/8/25.
 */
public class WaitingDialog extends Dialog {
    private Context context;
    private String title = "";

    private View contentView;

    @Bind(R.id.msg)
    TextView tvMsg;

    private String tips = "";

    /**
     * 构造方法
     * @param context 上下文
     * @param title 标题
     */
    public WaitingDialog(Context context, String title) {
        super(context, android.R.style.Theme_Translucent);
        this.context = context;
        this.title = title;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_waiting);
        ButterKnife.bind(this);

        contentView = findViewById(R.id.dg_content);
        tvMsg.setText(tips);
    }

    @Override
    public void show() {
        super.show();
    }

    @Override
    public void dismiss() {
        super.dismiss();
    }

    /**
     * 设置标题
     * @param title 内容
     */
    public void setTitle(String title) {
        this.title = title;
    }

    /**
     * 设置提示内容
     * @param tips 提示内容
     */
    public void setText(String tips) {
        this.tips = tips;
    }
}
